<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
<script>
  $.ajax({
    url: "/api/article/comments/html", success: function (content) {
      $("#comments").html(content);
    }
  });
</script>
<script>
var that = this;
fetch("/api/article/comments").then(function (res) {
  if (res.ok) {
    res.json().then(function (data) {
      that.contents = data.contents;
    });
  } else {
    console.log("Looks like the response wasn't perfect, got status", res.status);
  }
}, function (e) {
  console.log("Fetch failed!", e);
});
</script>
<script>
this.http.get<CommentsModel>('/api/article/comments')
  .subscribe(
    data => this.contents = data,
    err => console.log(err)
  );
</script>
</body>
</html>
